package com.emp.web;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.emp.bean.Emp;
import com.emp.service.EmpService;

@Controller
@RequestMapping("/emp")
public class EmpController {

	 @Resource
	 private EmpService empService;
	 
	 @RequestMapping("/list")
	 public String list(Model model) throws Exception{
		 List<Emp> es = empService.queryAllEmps();
		 model.addAttribute("es", es);
		 return "ListEmp";
	 }
}
